package cn.lesaas.esb.poc.tcp;

import org.apache.camel.builder.RouteBuilder;

public class TcpRoute extends RouteBuilder {

	@Override
	public void configure() throws Exception {
		from("direct:start").startupOrder(20)
				.to("netty4:tcp://172.16.100.39:59999?allowDefaultCodec=false&encoder=#stringEncoder&decoder=#stringDecoder")
				.to("log:VBSRESP?showAll=true");
		from("direct:xpath").choice()
			.when().xpath("/reqt/header/id='01'")
				.log("yes")
			.otherwise()
				.log("no")
			.end();
		from("direct:xpath1").setBody(xpath("/reqt/header/id/text()")).to("log:xpath?showAll=true");
	}

}
